/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package terminal.model;

import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import terminal.interfaces.IStringListener;

/**
 * Created on Dec 26, 2012
 * @author P. Podwapinski <p.podwapinski@gmail.com>
 */
public class TerminalStringListener implements IStringListener {

    /**
     * Constructor
     * @param document output document that will be filled with incoming data
     * after it has been processed
     */
    public TerminalStringListener( TerminalModel terminaModel )
    {
        m_terminalModel = terminaModel;
    }
    
    
    @Override public void onString( final String string )
    {
        if ( null != m_terminalModel )
        {
            m_terminalModel.addStringData( string );
        }
    }
    
   
    /**
     * Output Model
     */
    private TerminalModel m_terminalModel;
    
}
